<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>

</head>

<body>
    <div id="app">
        <p>{{msg}}</p>
        <p>{{message}}</p>
        <p v-once>{{msg}}</p>
        <p v-html="html"></p>
        <!-- 调用全局变量 -->
        <p>{{Math.random()}}</p>
        <p>{{new Date()}}</p>
    </div>

    <script>
        var app = new Vue({
            el: "#app",
            data: {
                msg: "msg",
                message: "message",
                html: "<div style='color:red' >123</div>"
            }
        });

       
        const arr = [30,50,70,20,5,15,60];



        let obj = {
            0:1,
            1:2,
            length:2
        }
        // // keys values entries

        // for in 键 
        console.dir(Object.entries(obj));
        for(let [index,val] of Object.entries(obj)){
            console.log(index,val);
        }


        
        for(let val of arr.entries()){
            console.log(val);
        }
        // for(let val in arr){
        //     console.log(val);
        // }
        // // for of   Symbol[Symbol.iterator]   值  对象不能用
        // for(let val of arr){
        //     console.log(val);
        // }

        // forEach  数组的
        // arr.forEach((val,index,arr)=>{
        //     console.log(index);
        //     console.log(val);
        //     console.log(arr);
        // })
        
        // console.log(arr.values());
        // for(let val of arr.values()){
        //     console.log(val);
        // }
        // for(let val of arr.entries()){
        //     console.log(val);
        // }

        
        

    </script>
</body>

</html>